package com.neo.service.impl;

import com.neo.bean.UserManagement;
import com.neo.mapper.UserManagementMapper;
import com.neo.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserManagementMapper userManagementMapper;

    @Override
    public UserManagement login(String accountNumber, String passWord) {
        UserManagement userManagement = new UserManagement();
        userManagement.setAccountNumber(accountNumber);
        userManagement.setPassWord(passWord);
        return userManagementMapper.selectOne(userManagement);
    }

    @Override
    public UserManagement login(String accountNumber) {
        UserManagement userManagement = new UserManagement();
        userManagement.setAccountNumber(accountNumber);
        return userManagementMapper.selectOne(userManagement);
    }

    @Override
    public UserManagement selectByTellPhone(String tellPhone) {
        UserManagement userManagement = new UserManagement();
        userManagement.setTelPhone(tellPhone);
        return userManagementMapper.selectOne(userManagement);
    }

    @Override
    public int updatePassWord(UserManagement userManagement) {
        return userManagementMapper.updateByPrimaryKeySelective(userManagement);
    }
}
